package com.itzou.controller;

import com.itzou.domain.result.R;
import com.itzou.service.SysLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/syslog")
public class SysLogController {

    private final SysLogService sysLogService;

    /**
     * 分页查询日志
     *
     * @param pageNo   页码
     * @param pageSize 每页大小
     * @return 分页结果
     */
    @GetMapping("/findByPage")
    public R findByPage(@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "10") Integer pageSize) {
        return R.ok(sysLogService.findByPage(pageNo, pageSize));
    }

}
